﻿using UnityEngine;
using System.Collections;

public class SceneManager 
{
    public BaseScene CurScene;

    public T Cur<T>( ) where T:BaseScene
    {
        return (T)CurScene;
    }
    public T LoadScene<T>(params object[] args) where T:BaseScene ,new()
    {
        if (CurScene != null)
        {
            CurScene.OnExit();
        }
        T newScene = new T();
        CurScene = newScene;
        newScene.OnLoad(args);
        return newScene;
    }

}
